package errmsg

const (
	ERROR_BASE = 400

	ERROR_NOT_PERMISION = 40000
	ERROR_TOKEN_VALID   = 40002

	ERROR_PARAMS_VALID  = 40040
	ERROR_DOUBLE_PWD    = 40041
	ERROR_USER_EXISTS   = 40042
	ERROR_LOGIN_ERR     = 40043
	ERROR_MODIFYPWD_ERR = 40044
)

var codeMsg = map[int]string{
	ERROR_BASE: "错误",

	ERROR_NOT_PERMISION: "您没有权限",
	ERROR_TOKEN_VALID:   "身份验证失败",

	ERROR_PARAMS_VALID:  "参数错误",
	ERROR_DOUBLE_PWD:    "两次密码不一致",
	ERROR_USER_EXISTS:   "用户已经存在",
	ERROR_LOGIN_ERR:     "账号或者密码错误",
	ERROR_MODIFYPWD_ERR: "密码不正确",
}

func GetErrMsg(code int) string {
	return codeMsg[code]
}
